const express = require('express');
const app = express();
const expressS = require('express-session');
const mongRouter = require('./routes/page');
const apiRouter = require('./routes/apI')
app.use(express.static('./public'));
app.use(expressS({
    name:'s_id',
    secret:"smile",
    saveUninitialized:false,
    resave:true,
    cookie:{
        httpOnly:true,
        maxAge:1000*60*60
    }
}))
app.use(mongRouter);
app.use(apiRouter);

app.listen(8000,()=>{
    console.log('端口8000启动');
});